
import Vue from 'vue';
import Vuex from 'vuex';
import { CHANGE_ROLE } from './mutationTypes'

interface roleConfig {
    type: 'change',
    rolename: ''
}

const namespaced= true


Vue.use(Vuex);

const state ={
    currentRole: ''
}

const getters= {
    getCurrentRole: (state: any) => {
        return state.currentRole
    }
}

const mutations ={
    [CHANGE_ROLE](state: any, value: roleConfig) {
        // 变更状态
        state.currentRole = value.rolename
    }
}

const actions = {
    //  TODO
}



export default {
    namespaced,
    state,
    getters,
    mutations,
    actions
}